home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / EPISODE / JKM_PCG.GOO / cog_s1l2_exploswitch.cog < prev    next >
Text File  |  1998-02-25  |  2KB  |  75 lines

  1. # Jedi Knight Missions Cog Script
  2. #
  3. # S1L2_Exploswitch.COG
  4. #
  5. # Shootable switch cog for level 2
  6. #
  7. # [DB & TL]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. #=========================================================
  11. symbols
  12.  
  13. message    damaged
  14. message    timer
  15. message activated                               
  16.  
  17. surface    panel             mask=0x008        linkid=1
  18. surface    button          mask=0x008        linkid=2
  19.  
  20. thing    sparkspot                nolink
  21. thing    door                           linkid=3
  22.  
  23. template        spark=+sparks            local
  24.  
  25. sound    sparksound        
  26. sound   kylelocked
  27. sound   wav0=lvrclik2.wav
  28.  
  29. flex    minimumDelay=2.0
  30. flex    maximumDelay=4.0
  31. flex    nextSpark=0.5                              local
  32.  
  33. end
  34.  
  35. #=========================================================
  36. code
  37. activated:
  38.         if (GetSenderId() == 3)
  39.         {
  40.                 PlaySoundLocal(kylelocked, 1, 0, 0);
  41.                 PlaySoundLocal(wav0, 1, 0, 0);
  42.         }
  43.         return;        
  44.  
  45. damaged:
  46.       if (GetWallCel(panel) == 1) return;
  47.     if (GetWallCel(button) == 1) return;
  48.     
  49.     
  50.     if ((GetSenderId() == 1) || (GetSenderId() == 2))     
  51.      {
  52.              SetWallCel(panel , 1);
  53.              SetWallCel(button , 1);
  54.              
  55.              MoveToFrame(door, 1, 5);        
  56.              CreateThing(spark, sparkspot);
  57.                  PlaySoundThing(sparksound, sparkspot, 1, -1, -1, 0);
  58.                 
  59.                 SetTimer(nextspark);    
  60.     }
  61.       return;
  62.  
  63. #............................................................
  64. timer:
  65.     CreateThing(spark, sparkspot);
  66.          PlaySoundThing(sparksound, sparkspot, 1, -1, -1, 0);
  67.  
  68.         nextSpark = minimumDelay + (Rand() * (maximumDelay - minimumDelay));
  69.     SetTimer(nextSpark);
  70.     return;
  71.  
  72.  
  73. end
  74.